package com.eastfair.venueservice.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.venueservice.enumeration.BondManageOrderStatusEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 保证金管理
 * </p>
 *
 * @author dqq
 * @since 2023-06-07
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vsm_bond_manage")
@ApiModel(value = "BondManage", description = "保证金管理")
@AllArgsConstructor
public class BondManage extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    @Size(max = 64, message = "订单编号长度不能超过64")
    @TableField(value = "order_number", condition = LIKE)
    @Excel(name = "订单编号")
    private String orderNumber;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_manage_id")
    @Excel(name = "展会id")
    private Long exhibitionManageId;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @Size(max = 255, message = "展会名称长度不能超过255")
    @TableField(value = "exhibition_manage_name", condition = LIKE)
    @Excel(name = "展会名称")
    private String exhibitionManageName;

    /**
     * 服务商id
     */
    @ApiModelProperty(value = "服务商id")
    @TableField(value = "service_provider_id")
    @Excel(name = "服务商id")
    private Long serviceProviderId;

    /**
     * 服务商名称
     */
    @ApiModelProperty(value = "服务商名称")
    @Size(max = 255, message = "服务商名称长度不能超过255")
    @TableField(value = "service_provider_name", condition = LIKE)
    @Excel(name = "服务商名称")
    private String serviceProviderName;

    /**
     * 主体类型(主场，配套服务商，搭建商 etc)
     */
    @ApiModelProperty(value = "主体类型(主场，配套服务商，搭建商 etc)")
    @Size(max = 64, message = "主体类型(主场，配套服务商，搭建商 etc)长度不能超过64")
    @TableField(value = "service_provider_type", condition = LIKE)
    @Excel(name = "主体类型(主场，配套服务商，搭建商 etc)")
    private String serviceProviderType;

    /**
     * 服务商code
     */
    @ApiModelProperty(value = "服务商code")
    @Size(max = 64, message = "服务商code长度不能超过64")
    @TableField(value = "service_provider_code", condition = LIKE)
    @Excel(name = "服务商code")
    private String serviceProviderCode;

    /**
     * 联系人
     */
    @ApiModelProperty(value = "联系人")
    @Size(max = 100, message = "联系人长度不能超过100")
    @TableField(value = "contact", condition = LIKE)
    @Excel(name = "联系人")
    private String contact;

    /**
     * 联系方式
     */
    @ApiModelProperty(value = "联系方式")
    @Size(max = 255, message = "联系方式长度不能超过255")
    @TableField(value = "phone", condition = LIKE)
    @Excel(name = "联系方式")
    private String phone;

    /**
     * 保证金金额
     */
    @ApiModelProperty(value = "保证金金额")
    @TableField(value = "bond_amount")
    @Excel(name = "保证金金额")
    private BigDecimal bondAmount;

    /**
     * 已付款金额
     */
    @ApiModelProperty(value = "已付款金额")
    @TableField(value = "pay_amount")
    @Excel(name = "已付款金额")
    private BigDecimal payAmount;

    /**
     * 0:未缴纳 1:缴纳 2:部分缴纳
     */
    @ApiModelProperty(value = "0:未缴纳 1:缴纳 2:部分缴纳")
    @Size(max = 50, message = "0:未缴纳 1:缴纳 2:部分缴纳长度不能超过50")
    @TableField(value = "pay_status", condition = LIKE)
    @Excel(name = "0:未缴纳 1:缴纳 2:部分缴纳")
    private String payStatus;

    /**
     * 可退款金额
     */
    @ApiModelProperty(value = "可退款金额")
    @TableField(value = "refundable_amount")
    @Excel(name = "可退款金额")
    private BigDecimal refundableAmount;

    /**
     * 实际退款金额
     */
    @ApiModelProperty(value = "实际退款金额")
    @TableField(value = "actual_refund_amount")
    @Excel(name = "实际退款金额")
    private BigDecimal actualRefundAmount;

    /**
     * 退款状态
     */
    @ApiModelProperty(value = "退款状态")
    @Size(max = 64, message = "退款状态长度不能超过64")
    @TableField(value = "refund_status", condition = LIKE)
    @Excel(name = "退款状态")
    private String refundStatus;

    /**
     * 退款时间
     */
    @ApiModelProperty(value = "退款时间")
    @TableField(value = "refund_time")
    @Excel(name = "退款时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime refundTime;

    /**
     * 退款方式
     */
    @ApiModelProperty(value = "退款方式")
    @Size(max = 64, message = "退款方式长度不能超过64")
    @TableField(value = "refund_way", condition = LIKE)
    @Excel(name = "退款方式")
    private String refundWay;

    /**
     * 扣除金额
     */
    @ApiModelProperty(value = "扣除金额")
    @TableField(value = "deduct_amount")
    @Excel(name = "扣除金额")
    private BigDecimal deductAmount;

    /**
     * 展商ID
     */
    @ApiModelProperty(value = "展商ID")
    @TableField(value = "exhibitor_id")
    @Excel(name = "展商ID")
    private Long exhibitorId;

    /**
     * 展厅编号
     */
    @ApiModelProperty(value = "展厅编号")
    @Size(max = 255, message = "展厅编号长度不能超过255")
    @TableField(value = "space_code", condition = LIKE)
    @Excel(name = "展厅编号")
    private String spaceCode;

    /**
     * 展厅
     */
    @ApiModelProperty(value = "展厅")
    @Size(max = 255, message = "展厅长度不能超过255")
    @TableField(value = "space_name", condition = LIKE)
    @Excel(name = "展厅")
    private String spaceName;

    /**
     * 展位
     */
    @ApiModelProperty(value = "展位")
    @Size(max = 255, message = "展位长度不能超过255")
    @TableField(value = "site_name", condition = LIKE)
    @Excel(name = "展位")
    private String siteName;

    /**
     * 展位编号
     */
    @ApiModelProperty(value = "展位编号")
    @Size(max = 255, message = "展位编号长度不能超过255")
    @TableField(value = "site_code", condition = LIKE)
    @Excel(name = "展位编号")
    private String siteCode;

    /**
     * 展位面积
     */
    @ApiModelProperty(value = "展位面积")
    @TableField(value = "site_area")
    @Excel(name = "展位面积")
    private BigDecimal siteArea;

    /**
     * 订单时间
     */
    @ApiModelProperty(value = "订单时间")
    @TableField(value = "order_time")
    @Excel(name = "订单时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime orderTime;

    /**
     * 保证金订单状态 #{NOT_SUBMIT:未提交;SUBMIT:已提交;DISPATCH:已派单;RECEIVE:已接单;COMPLETE:已完成;CANCEL:已取消}
     */
    @ApiModelProperty(value = "保证金订单状态 #{NOT_SUBMIT:未提交;SUBMIT:已提交;DISPATCH:已派单;RECEIVE:已接单;COMPLETE:已完成;CANCEL:已取消}")
    @TableField(value = "order_status")
    @Excel(name = "保证金订单状态 #{NOT_SUBMIT:未提交;SUBMIT:已提交;DISPATCH:已派单;RECEIVE:已接单;COMPLETE:已完成;CANCEL:已取消}", replace = {"未提交_NOT_SUBMIT", "已提交_SUBMIT", "已派单_DISPATCH", "已接单_RECEIVE", "已完成_COMPLETE", "已取消_CANCEL",  "_null"})
    private BondManageOrderStatusEnum orderStatus;

    /**
     * 设置保证金的系统标识，指的主场或场馆
     */
    @ApiModelProperty(value = "设置保证金的系统标识，指的主场或场馆")
    @Size(max = 255, message = "设置保证金的系统标识，指的主场或场馆长度不能超过255")
    @TableField(value = "system_scene", condition = LIKE)
    @Excel(name = "设置保证金的系统标识，指的主场或场馆")
    private String systemScene;

    /**
     * 保证金订单所属系统
     */
    @ApiModelProperty(value = "保证金订单所属系统")
    @Size(max = 64, message = "保证金订单所属系统长度不能超过64")
    @TableField(value = "belong_system", condition = LIKE)
    @Excel(name = "保证金订单所属系统")
    private String belongSystem;


    @Builder
    public BondManage(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    String orderNumber, Long exhibitionManageId, String exhibitionManageName, Long serviceProviderId, String serviceProviderName, String serviceProviderType, 
                    String serviceProviderCode, String contact, String phone, BigDecimal bondAmount, BigDecimal payAmount, String payStatus, 
                    BigDecimal refundableAmount, BigDecimal actualRefundAmount, String refundStatus, LocalDateTime refundTime, String refundWay, BigDecimal deductAmount, 
                    Long exhibitorId, String spaceCode, String spaceName, String siteName, String siteCode, BigDecimal siteArea, 
                    LocalDateTime orderTime, BondManageOrderStatusEnum orderStatus, String systemScene, String belongSystem) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.orderNumber = orderNumber;
        this.exhibitionManageId = exhibitionManageId;
        this.exhibitionManageName = exhibitionManageName;
        this.serviceProviderId = serviceProviderId;
        this.serviceProviderName = serviceProviderName;
        this.serviceProviderType = serviceProviderType;
        this.serviceProviderCode = serviceProviderCode;
        this.contact = contact;
        this.phone = phone;
        this.bondAmount = bondAmount;
        this.payAmount = payAmount;
        this.payStatus = payStatus;
        this.refundableAmount = refundableAmount;
        this.actualRefundAmount = actualRefundAmount;
        this.refundStatus = refundStatus;
        this.refundTime = refundTime;
        this.refundWay = refundWay;
        this.deductAmount = deductAmount;
        this.exhibitorId = exhibitorId;
        this.spaceCode = spaceCode;
        this.spaceName = spaceName;
        this.siteName = siteName;
        this.siteCode = siteCode;
        this.siteArea = siteArea;
        this.orderTime = orderTime;
        this.orderStatus = orderStatus;
        this.systemScene = systemScene;
        this.belongSystem = belongSystem;
    }

}
